import {
  IsEmail,
  IsMobilePhone,
  IsOptional,
} from 'class-validator';
import { UserDto } from './user.dto';

export class UpdateUserDto extends UserDto {

  @IsOptional()
  readonly username: string;

  @IsOptional()
  readonly password: string;

  // eslint-disable-next-line @typescript-eslint/camelcase
  @IsEmail({ allow_display_name: true }, { message: '邮箱格式错误' })
  @IsOptional()
  readonly email?: string;

  @IsMobilePhone('zh-CN', { message: '手机号码格式错误' })
  @IsOptional()
  readonly mobile: string;

}
